﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using HandyControl.Controls;
using HandyControl.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace AgileLogistics.ViewModel
{
   public class RepairViewModel: ViewModelBase
    {

        public RelayCommand<FunctionEventArgs<object>> SwitchItemCmd => new Lazy<RelayCommand<FunctionEventArgs<object>>>(() => new RelayCommand<FunctionEventArgs<object>>(SwitchItem)).Value;



        private void SwitchItem(FunctionEventArgs<object> info) => Growl.Info((info.Info as SideMenuItem)?.Header.ToString());
        private RelayCommand<string> menuChange => new Lazy<RelayCommand<string>>(() => new RelayCommand<string>(MenuChangeFunc)).Value;

        public RelayCommand<string> MenuChange
        {
            get
            {
                return menuChange;
            }
        }

        private void MenuChangeFunc(string menuHeader)
        {
            //HandyControl.Controls.Growl.SuccessGlobal(menuHeader);

            Page page = new Page();
            switch (menuHeader)
            {
                default:

                    break;
                case "新建维修单":
                    // Growl.SuccessGlobal("新建页面");
                    page = new View.Baoxiu.NewPage();
                    break;
                case "待办维修单":
                    // Growl.SuccessGlobal("查询页面");
                    page = new View.Baoxiu.WaitPage();
                    break;
                case "已处理维修单":

                    page = new View.Baoxiu.ListPage(true);
                    break;
                //case "部门维修单":

                //    page = new View.Baoxiu.ListPage();
                //    break;
                case "我创建的维修单":

                    page = new View.Baoxiu.ListPage(false);
                    break;

            }

            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<Page>(page, "BaoxiuNavigatePage");
        }






        #region 报修申请
        public Model.Repairs CurrRepair { get; set; }
        public List< Model.Repairs>  RepairList { get; set; }

        public List<Model.Depment> DepList { get; set; }
        #endregion




        #region Home数据

        //总维修单数
        public int SumCount { get; set; }
        public int HandleCount { get; set; }//已处理总数
        public int NewCount { get; set; } //待处理




        public List<int> NewList { get; set; }
        public List<int> HandleList { get; set; }
        public List<int> XiaolvList { get; set; }




        public List<string> WeekLabels = new List<string>();
        #endregion

    }
}
